﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TAM_SPORT
{
    public partial class DialogBase : Form
    {

        private bool isDenie;

        public bool IsDenie
        {
            get { return isDenie; }
            set { isDenie = value; }
        }

        private bool isAccept;

        public bool IsAccept
        {
            get { return isAccept; }
            set { isAccept = value; }
        }


        public DialogBase()
        {
            InitializeComponent();
        }

        public DialogBase(string s)
        {
            InitializeComponent();
            labelMessage.Text = s;
        }
        

        private const int CP_NOCLOSE_BUTTON = 0x200;
        protected override CreateParams CreateParams
        {
            get
            {
                CreateParams myCp = base.CreateParams;
                myCp.ClassStyle = myCp.ClassStyle | CP_NOCLOSE_BUTTON;
                return myCp;
            }
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnAccept_Click(object sender, EventArgs e)
        {
            try
            {
                this.isAccept = true;
                this.Close();
            }
            catch
            {

            }
        }

        private void btnNo_Click(object sender, EventArgs e)
        {
            try
            {
                this.isDenie = true;
                this.Close();
            }
            catch
            {

            }
        }

        protected void loadImage(string image_path)
        {
            try
            {
                ptbMain.Image = new Bitmap(image_path);
                ptbMain.SizeMode = PictureBoxSizeMode.Zoom;
            }
            catch (Exception ex)
            {
                ptbMain.Image = null;
                Console.WriteLine(ex);
            }
        }
    }
}
